import { axios } from '@/utils/request'

const api = {
  list: '/mch_admin/goods/list',
  edit: '/mch_admin/goods/edit',
  save: '/mch_admin/goods/save',
  status: '/mch_admin/goods/status',
  updateAll: '/mch_admin/goods/update-all',
  setAttrNum: '/mch_admin/goods/set-attr-num',
  copy: '/mch_admin/goods/goods-copy'
}

export default api

export function list (parameter) {
  return axios({
    url: api.list,
    method: 'get',
    params: parameter
  })
}

export function edit (parameter) {
  return axios({
    url: api.edit,
    method: 'get',
    params: parameter
  })
}

export function save (parameter) {
  return axios({
    url: api.save,
    method: 'post',
    data: parameter
  })
}

export function status (parameter) {
  return axios({
    url: api.status,
    method: 'get',
    params: parameter
  })
}

export function updateAll (parameter) {
  return axios({
    url: api.updateAll,
    method: 'get',
    params: parameter
  })
}

export function setAttrNum (parameter) {
  return axios({
    url: api.setAttrNum,
    method: 'post',
    data: parameter
  })
}

export function Copy (parameter) {
  return axios({
    url: api.copy,
    method: 'get',
    params: parameter
  })
}
